package com.manlook.cacciatesoromuseale;

import android.view.Menu;
import android.view.Window;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import android.app.Activity;
import android.os.Bundle;

public class MuseodiCapodimonte extends Activity {

	String url;
	WebView webView;
	final Activity activity = this;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
		setContentView(R.layout.activity_museodi_capodimonte);
		webView = (WebView) findViewById(R.id.sito);
		webView.getSettings().setJavaScriptEnabled(true);

		webView.setWebChromeClient(new WebChromeClient()

		{
			public void onProgressChanged(WebView view, int progress) {
				activity.setTitle("Loading...");
				activity.setProgress(progress * 100);

				if (progress == 100)
					activity.setTitle(R.string.app_name);
			}
		});
		webView.setWebViewClient(new WebViewClient()

		{
			public void onReceivedError(WebView view, int errorCode,
					String description, String failingUrl) {
				// Handle the error
			}

			public boolean shouldOverrideUrlLoading(WebView view, String url_poi)

			{

				view.loadUrl(url_poi);

				return true;

			}
		});

		webView.loadUrl("http://www.polomusealenapoli.beniculturali.it/museo_cp/museo_cp.html");

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {

		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.museodi_capodimonte, menu);
		return true;
	}

}
